<?php
abstract class version
{
	public static function install($prefix)
	{
		// Installing over version < 1.3
		db::query('DROP TABLE `'.$prefix.'album`', false);
		
		db::query('ALTER TABLE `'.$prefix.'Image` DROP COLUMN `album_id`', false);
		db::query('ALTER TABLE `'.$prefix.'Image` ADD `User_id` INT(10) UNSIGNED', false);
		db::query('ALTER TABLE `'.$prefix.'Image` ADD `upload_id` CHAR(13)', false);
		db::query('ALTER TABLE `'.$prefix.'Image` ADD `private` TINYINT(1) UNSIGNED', false);
		db::query('ALTER TABLE `'.$prefix.'Image` ADD `title` VARCHAR(25)', false);
		db::query('ALTER TABLE `'.$prefix.'Image` ADD `description` VARCHAR(255)', false);
		db::query('ALTER TABLE `'.$prefix.'Image` ALTER `extension` ENUM("jpg", "png", "gif", "wbmp")', false);
		
		db::query('CREATE TABLE `'.$prefix.'upload` (
			`id` CHAR(13),
			`date` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
			PRIMARY KEY (`id`)
		)', false);
	}
}